<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Core.DAL.tSite_Convoc>" %>

<asp:Content ID="cHead" ContentPlaceHolderID="cphHead" runat="server">
    <% this.Page.Title = (string)ViewData["PageTitle"]; %>
</asp:Content>

<asp:Content ID="cMeta" ContentPlaceHolderID="cphMeta" runat="server">
    <meta name="title" content="<%= ViewData["PageTitle"] %>" />
    <link rel="image_src" href="<%= ViewData["MetaThumbnail"]  %>" />
</asp:Content>

<asp:Content ID="cScript" ContentPlaceHolderID="cphJScripts" runat="server">
    <% if ((UserType)ViewData["UserType"] != UserType.User && ViewData["Convoc"] != null){  %>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#adminMenu .delete a").colorbox({ width: "400px", height: "190px", iframe: true, title: "Supprimer cette convoc" });
        });

        function DeleteConvoc(CID) {
            $.post('<%= Url.Action("Delete", new { controller = "convoc" }) %>', { id: CID }, function (data) {
                document.location = '<%= Url.Action("Index", new { controller = "convoc" }) %>';
            });
        }
    </script>
    <% } %>
</asp:Content>

<asp:Content ID="cBreadCrumb" ContentPlaceHolderID="cphBreadCrumb" runat="server">
    <div id="infoBread">
        <div class="fb-like" data-send="false" data-layout="button_count" data-width="50" data-show-faces="false"></div>
    </div>
</asp:Content>

<asp:Content ID="cMainContent" ContentPlaceHolderID="cphMainContent" runat="server">
    <div id="convoc">
	    <div class="postBy">Convoc du <%= Model.StartDate.ToString("dd/MM/yyyy") %> au <%= Model.EndDate.ToString("dd/MM/yyyy")%></div>

        <%= Model.Convoc %>
    
        <hr />
        
        <% if (ViewData["OtherConvoc"] != null && ((List<tSite_Convoc>)ViewData["OtherConvoc"]).Count > 0){ %>
        <h1>Voir aussi les autres convocs <%= ((string)ViewData["SectionName"]).ToLower() %></h1>
        <ul class="otherConvoc">
        <% foreach (tSite_Convoc c in (List<tSite_Convoc>)ViewData["OtherConvoc"]){ %>
            <li><%= Html.ActionLink("Convoc du " + c.StartDate.ToString("dd/MM/yyyy") + " au " + c.EndDate.ToString("dd/MM/yyyy"), "Detail", new { controller = "Convoc", systemName = (string)ViewData["SystemName"], ID = c.ID }, new { title = "Convoc du " + c.StartDate.ToString("dd/MM/yyyy") + " au " + c.EndDate.ToString("dd/MM/yyyy") })%></li>
        <% } %>
        </ul>
        <% } %>
        <div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
        <div class="clr"></div>
    </div>
</asp:Content>

<asp:Content ID="cAdminMenu" runat="server" ContentPlaceHolderID="cphAdminMenu">
    <% if ((UserType)ViewData["UserType"] != UserType.User){  %>
    <ul id="adminMenu">
        <li class="create"><%= Html.ActionLink(ScoutNET.Resources.Convoc_Index_CreateLink, "Create", new { controller = "Convoc", systemName = (string)ViewData["SystemName"] })%></li>
        <% if (ViewData["Convoc"] != null){ %>
        <li class="edit"><%= Html.ActionLink(ScoutNET.Resources.Convoc_Index_EditLink, "Edit", new { controller = "Convoc", ID = ((tSite_Convoc)ViewData["Convoc"]).ID, systemName = (string)ViewData["SystemName"] })%></li>
        <li class="delete"><%= Html.ActionLink(ScoutNET.Resources.Convoc_Index_DeleteLink, "Delete", new { controller = "Convoc", ID = ((tSite_Convoc)ViewData["Convoc"]).ID, systemName = (string)ViewData["SystemName"] })%></li>
        <% } %>
    </ul>
    <% } %>
</asp:Content>

